# -*- coding:utf-8 -*-

def p(base , exp):
	if exp == 0:
		return 1
	if exp == 1:
		return base
	if exp % 2 == 0:
		return p(base*base,exp/2)
	else:
		return p(base*base,exp//2)*base

class Solution:
    def Power(self, base, exponent):
        if exponent < 0:
        	exponent = -exponent
        	return 1.0/p(base,exponent)
        return p(base,exponent)

